package org.sith.taskrunner.gwt.server.services.taskrunner;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import org.sith.taskrunner.gwt.client.services.taskrunner.GetTasksToRunService;
import org.sith.taskrunner.gwt.shared.domains.WrapperData;

import java.util.ArrayList;
import java.util.List;


public class GetTasksToRunServiceImpl extends RemoteServiceServlet implements GetTasksToRunService {
    @Override
    public List<WrapperData> getWrappersData() {
        List<WrapperData> wrapperDataList = new ArrayList<WrapperData>();
        wrapperDataList.add(createWrapper("1", "SimpleWrapper1", "Simple wrapper 1"));
        wrapperDataList.add(createWrapper("2", "SimpleWrapper2", "Simple wrapper 2"));
        return wrapperDataList;
    }

    private WrapperData createWrapper(String version, String simpleWrapper1, String wrapperDescription) {
        WrapperData data= new WrapperData();
        data.setVersion(version);
        data.setWrapperName(simpleWrapper1);
        data.setWrapperDescription(wrapperDescription);
        return data;
    }
}